package cn.gson.springboot.model.dao.presaledao;

import cn.gson.springboot.model.pjos.CompetingProducts;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface CompetingProductsDao extends CrudRepository<CompetingProducts, Integer> {

    /**
     * 查询竞品信息
     * @param comProductsId
     * @return
     */
    @Query(value = "select * from  competing_products where com_products_id=?1", nativeQuery = true)
    CompetingProducts queryComproducts(Integer comProductsId);

    /**
     * 查询竞品名称是否重复
     */
    @Query(value = "select * from  competing_products where com_products_name=?1", nativeQuery = true)
    CompetingProducts isNotComproductsName(String comProductsame);
}
